package org.linsoho.xmlupdate;

import java.io.File;
import java.io.FileReader;
import java.util.Iterator;
import java.util.Properties;

public class PropertyReader extends Properties {
    
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    public PropertyReader() {
        String path = PropertyReader.class.getResource("/").getPath();
        try {
            File propFile = new File(path + "/resources/xmlupdate.properties");
            if (propFile.exists()) {
                FileReader reader = new FileReader(propFile);
                this.load(reader);
                Iterator<String> it= this.stringPropertyNames().iterator();
                while(it.hasNext()){
                    String key=it.next();
                    System.out.println(key+ ":" + this.getProperty(key));
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
